package pnlSwitch;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import pnlMain.PnlWelkom;
import frame.FrameResBeheer;

public class RBPanelSwitcher implements ActionListener {

	private FrameResBeheer frameResBeheer;
	private PnlWelkom pnlWelkom;

	public RBPanelSwitcher(FrameResBeheer frameResBeheer) {
		this.frameResBeheer = frameResBeheer;
	}

	public RBPanelSwitcher(PnlWelkom pnlWelkom) {
		this.pnlWelkom = pnlWelkom;
	}

	public void actionPerformed(ActionEvent e) {
			System.out.println(pnlWelkom);
		if (e.getActionCommand().equals("consumtie")) {
			frameResBeheer.getPnlGD().setVisible(true);
			frameResBeheer.getPnlM().setVisible(false);
			frameResBeheer.getPnlC().setVisible(false);
			System.out.println("Consumtie beheer activated");
		}
		if (e.getActionCommand().equals("menu")) {
			frameResBeheer.getPnlGD().setVisible(false);
			frameResBeheer.getPnlM().setVisible(true);
			frameResBeheer.getPnlC().setVisible(false);
			System.out.println("Menu beheer activated");
		}
		if (e.getActionCommand().equals("categorie")) {
			frameResBeheer.getPnlGD().setVisible(false);
			frameResBeheer.getPnlM().setVisible(false);
			frameResBeheer.getPnlC().setVisible(true);
			System.out.println("Categorie beheer activated");
		}

	}
}
